package com.ruoyi.business.api;

import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import com.google.common.collect.Maps;
import com.ruoyi.business.constants.Constant;
import com.ruoyi.business.service.CommonDataService;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.RedisUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.system.service.ISysConfigService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
import java.util.Map;

/**
 * @author liutao
 * @version 1.0
 * @description: TODO
 * @date 2024/3/26 18:34
 */

@RestController
@RequestMapping("/api/common/data")
public class CommonDataApi {

    @Resource
    private CommonDataService commonDataService;

    @GetMapping("/dict")
    public R<List<Map<String, Object>>> getDictData(@RequestParam String dictType) {
        return R.ok(commonDataService.getDictData(dictType));
    }

    @GetMapping("/user/list")
    public R<List<Map<String, Object>>> getUserList() {
        return R.ok(commonDataService.getUserList());
    }

}
